package itdfq.ydd.Behavior_Patters.Iterator;

import itdfq.dfq.Behavior_Patters.Iterator.Music;
import itdfq.dfq.Behavior_Patters.Iterator.MusicIterator;
import itdfq.ydd.Creational_Pattern.chouxianggongchang.Mianmo;

/**
 * @Author GocChin
 * @Date 2021/5/15 14:32
 * @Blog: itdfq.com
 * @QQ: 909256107
 * @Descript:
 */
public class Client {
    public static void main(String[] args) {
        System.out.println("18031210111   杨丹丹");
        People people;
        people= (People) XMLUtil.getBean();
        play(people);
        NOplay(people);

    }
    public static void play(People people){
        PeopleIterator iterator = people.createIterator();
        System.out.println("音乐列表：");
        while (!iterator.isLast()){
            System.out.println(iterator.nowNumber().toString());
            iterator.next();
        }
    }
    public static void NOplay(People people){
        PeopleIterator iterator = people.createIterator();
        iterator.setNumber(4);
        System.out.println("音乐列表：");
        while (!iterator.isFirst()){
            iterator.previous();
            System.out.println(iterator.nowNumber().toString());

        }
    }
}
